<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    // 默认是挂载到全局的window对象上
    // function sum() {
    //   console.log(this, '6666')
    // }

    // sum()
    // window.sum()

    // const fn1 = () => {
    //   console.log(this)
    // }
    // fn1()

    // const obj = {
    //   sum: () => {
    //     console.log(this)
    //   }
    // }
    // obj.sum()


    function sum(num1, num2 = 99, ...args) {
      console.log(num1, num2, args)
    }

    sum()
    sum(100)
    sum(100, 200)
    sum(1, 2, 3, 4, 5)

  </script>
</body>

</html>